package com.sqfw.common.enums.system;

import lombok.Getter;

/**
 * 签名数据类型，方便查询数据库
 * Oper
 * */
public enum SysBssSignTypeEnum {

    LOGIN_LOG("LOGIN_LOG", "登录日志"),
    WP_PHONE("WP_PHONE_IDCARD_WPID", "工单手机号,身份证,工单编号"),
    LOGIN_PASSWORD("LOGIN_PASSWORD", "用户登录密码"),
    OPER_LOG("OPER_LOG", "用户操作日志"),
    // Password-encrypt
    USER_PASSWORD_ENCRYPT("USER_PASSWORD_ENCRYPT", "用户密码加密"),
    // phoneno--ID card
    WP_PHONENO_IDCARD_ENCRYPT("WP_PHONENO_IDCARD_ENCRYPT", "工单手机号+工单身份证加密"),
    // 用户菜单
    USER_MENU("USER_MENU", "用户菜单"),
    DM_LOG("DM_LOG", "DM数据库log"),
    JAR_DATA("JAR_DATA", "jar包内容"),
    ;

    @Getter
    private String key;
    @Getter
    private String desc;

    SysBssSignTypeEnum(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    /**
     * 根据key，查询描述
     * */
    public static SysBssSignTypeEnum by(String key) {
        SysBssSignTypeEnum[] enums = SysBssSignTypeEnum.values();
        for (int i = 0; i < enums.length; i++) {
            if (key.equals(enums[i].key) ) {
                return enums[i];
            }
        }
        return null;
    }
}
